<template>
	<view class="rich">
		<uv-parse :content="content"></uv-parse>
	</view>
</template>

<script setup>
	import {
		ref,
		defineComponent
	} from 'vue';
	import {
		doRich
	} from '@/apis/home.js'
	import {
		onLoad,
		onReachBottom,
		onPullDownRefresh
	} from "@dcloudio/uni-app";

	const content = ref(``)

	onLoad(async (e) => {
		const arr = [{
			label: '隐私政策',
			value: 'yszc',
			enum: 'PROTECTION'
		}, {
			label: '用户协议',
			value: 'yhxy',
			enum: 'REGISTER_AGREEMENT'
		}, {
			label: '入驻协议',
			value: 'rzxy',
			enum: 'ENTRY_EXPLAIN'
		}, {
			label: '发布协议',
			value: 'fbxy',
			enum: 'ISSUE_AGREEMENT'
		}, {
			label: '佣金说明',
			value: 'yjsm',
			enum: 'BROKERAGE_EXPLAIN'
		}]
		const info = arr.find(el => el.value === e.val)
		uni.setNavigationBarTitle({
			title: info.label
		})
		const data = await doRich(info.enum)
		content.value = data.content
	})
</script>

<style lang="scss" scoped>
	.rich {
		padding: 24rpx;
	}
</style>